<?php

class Login extends Eloquent {
	protected $table = 'login';

	/**
	 * Condition: Unarchived Items.
	 * @author AngelaMisa 02/23/2015 9:51PM
	 * @param $query
	 * @return mixed
	 */
	public function scopeActive( $query ) {
		return $query->where($this->table . '.archived', 0);
	}
	
	/**
	 * Relates to Company.
	 * @author AngelaMisa 02/23/2015 9:51PM
	 * @return mixed
	 */
	public function company() {
		return $this->belongsTo('Company', 'COMPANY_id');
	}
	
	/**
	 * Relates to CompanyBranch.
	 * @author AngelaMisa 02/23/2015 9:51PM
	 * @return mixed
	 */
	public function employee() {
		return $this->belongsTo('CompanyBranch', 'BRANCH_id');
	}
}